<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/displaytag-11.tld" prefix="display"%>
<%@ page import="java.util.*, java.text.SimpleDateFormat"%>
<%@ page import="com.cs.beneficios.business.model.RepDetBOTVO,com.cs.beneficios.business.model.RepAtributoVO,com.cs.beneficios.business.model.ReporteTotalProgramasVO"%>

<html>
<head>
<script language="JavaScript" src="<%= request.getContextPath() + "/js/popUP.js" %>"></script>
<link href="<%= request.getContextPath() + "/css/bloques.css" %>" rel="stylesheet" type="text/css">
<!--<link href="<%= request.getContextPath() + "/css/table.css" %>" rel="stylesheet" type="text/css">-->

<script src="<%=request.getContextPath()%>/js/displaytag.js" type="text/javascript"></script>
</head>
<body>
<form name="frmreporte" action="<%=request.getContextPath()+"/Reportes/Totales/ReportTotalBOT.do"%>" method="get">

<logic:present scope="request" name="msg">
  <BR>
  <strong><DIV align="center" class="titulosenblanco"><%=(String)request.getAttribute("msg")%></DIV></strong>
  <BR>
</logic:present>

<logic:present scope="request" name="errorfecha">
  <BR>
  <strong><DIV align="center" class="titulosenblanco"><%=(String)request.getAttribute("errorfecha")%></DIV></strong>
  <BR>
</logic:present> 

<logic:notPresent scope="request" name="msg">

<div align="center">
<logic:present name="Beneficios">

      <table  cellspacing="3" cellpadding="2" border="0" align="center">
        <tr>
        <td>
          <div align="center" class="titulosenblanco">
            Reporte Total Programas y Beneficios
          </div>
        </td>
        </tr>
        <tr>
        <td>
          <div align="center" class="titulosenblanco">
            <%Calendar cal = Calendar.getInstance();
              SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy hh:mm");%>
              Fecha: <%=formato.format(cal.getTime())%>
          </div>
        <td>
        </tr>
        <tr>
          <td>
            <%ReporteTotalProgramasVO objRtpVO = (ReporteTotalProgramasVO)session.getAttribute("Filters");
            if(objRtpVO != null){%>
            <table cellspacing="3" cellpadding="2" border="0" align="center" class="titulosenblanco">
              <%if(objRtpVO.getNombreArea() != null){%>
              <tr>
                <td>
                  Secretar�a: <%=objRtpVO.getNombreArea()%>
                </td>
              </tr>
              <%}%>
              <%if(objRtpVO.getNombrePrograma() != null){%>
              <tr>
                <td>
                  Programa: <%=objRtpVO.getNombrePrograma()%>
                </td>
              </tr>
              <%}%>
              <%if(objRtpVO.getNombreSubprograma() != null){%>
              <tr>
                <td>
                  Subprograma: <%=objRtpVO.getNombreSubprograma()%>
                </td>
              </tr>
              <%}%>
              <%if(objRtpVO.getDesde() != null && !objRtpVO.getDesde().equals("")){%>
              <tr>
                <td>
                  Fecha Inicial: <%=objRtpVO.getDesde()%>
                </td>
              </tr>
              <%}%>
              <%if(objRtpVO.getHasta() != null && !objRtpVO.getHasta().equals("")){%>
              <tr>
                <td>
                  Fecha Final: <%=objRtpVO.getHasta()%>
                </td>
              </tr>
              <%}%>
            </table>
            <%}
              session.removeAttribute("Filters");%>
          </td>
        </tr>
       <%-- <tr>
    <td class="celdatabla" width="31%">Fecha inicial:</td>
    <td align="left">
      <FONT class="celdatabla">dia</FONT> <select name="dia1" onclick="habilita('mes1')" Class="form">
      <option value="nulo">---</option>
<%                  
      for(int d = 1; d<=31;d++)
      {
        String dia = d+"";
        if(d<10) dia = "0"+d;
%>
      <option Class="form" value="<%=dia%>"><%=dia%></option>
     
<%          
      }                  
%>                  
            
      </select>
      <FONT class="celdatabla">mes</FONT> <select disabled="disabled" name="mes1" onchange="habilita('ano1')" Class="form">
      <option value="nulo">---</option>
<% 
      for(int m = 1; m<=12;m++)
      {
        String mes = m+"";
        if(m<10) mes = "0"+m;
%>
        <option Class="form" value="<%=mes%>"><%=mes%></option>
<%          
      }                  
%>

      </select>
      <FONT class="celdatabla">a&ntilde;o</FONT> <select disabled="disabled" name="ano1" onchange="validar('dia1','mes1','ano1')" Class="form">
      <option value="nulo">-----</option>
<% 
    for(int a = 1990; a<=2040;a++)
    {
      String ano = a+"";
%>                  
      <option Class="form" value="<%=ano%>"><%=ano%></option>

<%          
    }                  
%>                  
      
      </select>
    </td>
    
    
    <td class="celdatabla" width="25%">&nbsp;</td>
  </tr>
  <tr>
    <td class="celdatabla" width="31%">Fecha final:</td>
    <td align="left">
      <FONT class="celdatabla">dia</FONT> <select name="dia2" onchange="habilita('mes2')" Class="form">
      <option value="nulo">---</option>
<%                  
      for(int d = 1; d<=31;d++)
      {
        String dia = d+"";
        if(d<10) dia = "0"+d;
%>
      <option Class="form" value="<%=dia%>"><%=dia%></option>
     
<%          
      }                  
%>                  
            
      </select>
      <FONT class="celdatabla">mes</FONT> <select name="mes2" onchange="habilita('ano2')" disabled="disabled" Class="form">
      <option value="nulo">---</option>
<% 
      for(int m = 1; m<=12;m++)
      {
        String mes = m+"";
        if(m<10) mes = "0"+m;
%>
        <option Class="form" value="<%=mes%>"><%=mes%></option>
<%          
      }                  
%>

      </select>
      <FONT class="celdatabla">a&ntilde;o</FONT> <select name="ano2" disabled="disabled" onchange="validar('dia2','mes2','ano2')" Class="form">
      <option value="nulo">-----</option>

<% 
    for(int a = 1990; a<=2040;a++)
    {
      String ano = a+"";
%>                  
      <option Class="form" value="<%=ano%>"><%=ano%></option>

<%          
    }                  
%>                  
      
      </select>
    </td>
    
    
    
    <td class="celdatabla" width="25%">&nbsp;</td>
  </tr>--%>
        <tr>
        <td>
          <div align="center">
          <display:table name="sessionScope.Beneficios" summary="sadsa" id="report"  export="true" cellpadding="3" cellspacing="1" style="width:100%" class="bordestable">
            <display:column headerClass="headerTable" title="SECRETARIA" class="Numero" sortable="true" group="1">
              <bean:write name="report" property="nombreArea"/>  
            </display:column>            
            <display:column headerClass="headerTable" title="SUBSECRETARIA" class="Numero" sortable="true" group="2">
              <bean:write name="report" property="nombreSubarea"/>  
            </display:column>
            <display:column headerClass="headerTable" title="PROGRAMA" class="Numero" sortable="true" group="3">
              <bean:write name="report" property="nombrePrograma"/>
            </display:column>
            <display:column headerClass="headerTable" title="BENEFICIO" class="Numero" sortable="true">
              <bean:write name="report" property="nombreSubprograma"/>  
            </display:column>
            <display:column headerClass="headerTable" title="BENEFICIARIOS" class="Numero" sortable="true">
              <bean:write name="report" property="cantidadBeneficiarios"/>  
            </display:column>
            <display:column headerClass="headerTable" title="BENEFICIOS" class="Numero" sortable="true" >
              <bean:write name="report" property="cantidadBeneficios"/>  
            </display:column>
            <display:column headerClass="headerTable" title="VALOR" class="Numero" sortable="true" >
              <bean:write name="report" property="valorBeneficios"/>  
            </display:column>
           </display:table>
          </div>
        </td>
        </tr>
      </table>
      
</logic:present>

<logic:notPresent name="Beneficios">

  <BR>
  <strong><DIV align="center" class="titulosenblanco">No hay registros que cumplan con los filtros o condiciones seleccionadas</DIV></strong>
  <BR>

</logic:notPresent>

</div>  
</logic:notPresent>
<logic:present scope="request" name="msg">
  <%request.removeAttribute("msg");%>
</logic:present> 

</form>
</body>
</html>